import React from 'react';
import { InterviewDetail } from '@/pages/RecruitEmail/pc/components';
import styles from './index.less';

const LABOUR_PERIOD_TYPE = [
    { value: 1, text: '年' },
    { value: 2, text: '月' }
];
// 试用期类型单位
const PROBATION_PERIOD_TYPE = [
    { value: 1, text: '月' },
    { value: 2, text: '天' }
];

const RejectPage = ({ data }) => {
    const renderLabourPeriod = () => {
        if (data?.labourPeriodNumber === -1) {
            return <span>无固定期限</span>;
        }
        return (
            <>
                <span>
                    {`${data?.labourPeriodNumber}`}
                    {`${LABOUR_PERIOD_TYPE.find(item => item.value === data?.labourPeriodType)?.text}`}
                </span>
            </>
        );
    };
    const list = [
        {
            key: '任职部门',
            iconType: 'mianshishenqing',
            showIcon: true,
            value: data?.departmentName || '--'
        },
        {
            key: '任职岗位',
            showIcon: true,
            iconType: 'infos_namecard_icon_default1',
            value: data?.dutyName || '--'
        },

        {
            key: '入职时间',
            showIcon: true,
            iconType: 'timeAdjusted',
            value: data?.suggestedEntryTime
        },
        {
            key: '服务期限',
            iconType: 'infos_namecard_icon_default',
            showIcon: true,
            value: (
                <span>
                    {renderLabourPeriod()}
                    {`，包含${data?.probationPeriodNumber}${data?.probationPeriodType === 1 ? '个' : ''}${
                        PROBATION_PERIOD_TYPE.find(item => item.value === data?.probationPeriodType)?.text
                    }试用期`}
                </span>
            )
        }
    ];

    return (
        <div
            style={{
                maxWidth: 504,
                margin: '0 auto',
                boxSizing: 'border-box',
                height: '100%'
            }}
        >
            {/* 123 */}
            <div
                style={{ marginTop: 80, marginBottom: 141 }}
                // className={cn(styles.detailCon, {
                //     [styles.mb46]: status === STATUS.ACCEPT,
                //     [styles.mb79]: status === STATUS.UPDATE || status === STATUS.REFUSE,
                //     [styles.trans]: status === STATUS.REFUSE
                // })}
            >
                <div className={styles.refuseTitle}>感谢反馈原因，期待我们之间能有更多故事。</div>
                <div className={styles.luyong}>录用信息</div>
                <InterviewDetail
                    dataSource={list}
                    // style={{ marginBottom: 16 }}
                    keyStyle={{
                        fontWeight: 400,
                        height: '22px',
                        fontSize: '14px',
                        fontFamily: 'PingFangSC-Regular, PingFang SC',
                        color: 'rgba(0,0,0,0.25)',
                        lineHeight: '22px'
                    }}
                    valueStyle={{
                        height: '26px',
                        fontSize: '18px',
                        fontFamily: 'PingFangSC-Regular, PingFang SC',
                        fontWeight: 400,
                        color: 'rgba(0,0,0,0.25)',
                        lineHeight: '26px'
                    }}
                />
            </div>
        </div>
    );
};

export default RejectPage;
